package com.java.exer1;

public class BankTest_1 {
    private CustomerTest_2[] customers;
    private int numberOfCustomer;

    public BankTest_1() {
        customers = new CustomerTest_2[10];
    }

    //添加客户
    public void addCustomer1(String f, String l) {
        CustomerTest_2 customer = new CustomerTest_2(f, l);
        customers[numberOfCustomer++] = customer;
    }

    //添加客户个数
    public int getNumberOfCustomer() {
        return numberOfCustomer;
    }

    //获取指定位置上的客户
    public CustomerTest_2 getCustomer1(int index) {
        if (0 <= index && index < numberOfCustomer) {
            return customers[index];
        } else {
            return null;
        }
    }
}
